package com.naiterui.ehp.bs.b2c.product.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 商品信息主表
 *
 * @author zhoupeipei
 * @date 2019-05-17 14:33
 * @since 1.0.0
 */
@Data
@Entity
@NoArgsConstructor
@Table(name = "p_product")
public class Product implements Serializable {

    /**
     * 商品类型-药品
     */
    public static final int TYPE_MEDICINE = 1;
    /**
     * 商品类型-保健品
     */
    public static final int TYPE_HEALTH = 2;

    /**
     * 处方药
     */
    public static final int NMPA_TYPE_RX = 1;
    /**
     * OTC
     */
    public static final int NMPA_TYPE_OTC = 2;

    private static final long serialVersionUID = 5805501843772510781L;
    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 产品编号
     */
    @Column(name = "number", nullable = false)
    private String number;

    /**
     * 药理分类ID
     */
    @Column(name = "classification_id")
    private Long classificationId;

    /**
     * 商品种类 1:药品 2:保健品
     */
    @Column(name = "type", nullable = false)
    private Integer type;

    /**
     * name
     */
    @Column(name = "name", nullable = false)
    private String name;

    /**
     * 通用名
     */
    @Column(name = "common_name", nullable = false)
    private String commonName;

    /**
     * 品牌名称
     */
    @Column(name = "brand_name")
    private String brandName;

    /**
     * 药监局分类，1：处方药；2：otc
     */
    @Column(name = "nmpa_type", nullable = false)
    private Integer nmpaType;

    /**
     * 批准文号/注册码
     */
    @Column(name = "approval_number", nullable = false)
    private String approvalNumber;

    /**
     * 生产企业
     */
    @Column(name = "production_enterprise", nullable = false)
    private String productionEnterprise;

    /**
     * 是否关联SKU  0：未关联，1：关联
     */
    @Column(name = "relation_sku", nullable = false)
    private Integer relationSku;

    /**
     * 资料完整  0：不完整，1：完整
     */
    @Column(name = "data_integrity", nullable = false)
    private Integer dataIntegrity;

    /**
     * 是否有效，0：无效；1：有效
     */
    @Column(name = "valid", nullable = false)
    private Integer valid;

    /**
     * 创建时间
     */
    @Column(name = "created_at", nullable = false)
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by", nullable = false)
    private String createdBy;

    /**
     * 修改人
     */
    @Column(name = "changed_by", nullable = false)
    private String changedBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at", nullable = false)
    private Date changedAt;

    /**
     * 乐观锁
     */
    @Version
    @Column(name = "version", nullable = false)
    private Integer version;

}
